package com.crrc.dataparse.config;

import com.crrc.dataparse.entity.PaserInfo;
import com.crrc.dataparse.util.DataInitializer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class InitializationConfig {

    @Autowired
    private ParseConfig parseConfig;

    /**
     * 初始化PaserInfo并交由Spring容器管理
     */
    @Bean
    public PaserInfo paserInfo() {
        System.out.println("开始初始化PaserInfo...");
        PaserInfo paserInfo = DataInitializer.getPaserInfo(parseConfig.getFilepath());
        System.out.println("PaserInfo初始化完成");
        return paserInfo;
    }

}
